<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2010-11-17
 * Time: 11:57:34
 * To change this template use File | Settings | File Templates.
 */
 
class systemComponents extends sfComponents
{
    public function executeHeader()
    {
    }

    public function executeFooter()
    {
        
    }

    public function executeNavigator(sfWebRequest $request)
    {}

    public function executeMenuNavigator(sfWebRequest $request)
    {
        $cssStr = "address_tit";
        if($this->cssStr)
             $cssStr = $this->cssStr;
        
         $this->cssStr = $cssStr;// ="address_tit address_tit301";
        if($this->catalogId == null)
            $this->catalogId = 1000;
        $catalogs = Doctrine_Core::getTable("Catalog")->createQuery()
                 ->where("catalog_id=?", $this->catalogId)
                ->execute();
        $this->catalog = null;
        foreach($catalogs as $catalog)
        {
             $this->catalog = $catalog;
             break;
        }
        if($this->catalog == null)
        {
             $this->catalog = new Catalog();
             $this->catalog->setCatalogId($this->type) ;
//             switch($this->type)
//             {
//                 case 5: //login
//                    $this->catalog->setDescription("用户登录");
//                    break;
//                 case 6: //registor
//                    $this->catalog->setDescription("用户注册");
//                    break;
//                 case 7: //MY Easy
//                    $this->catalog->setDescription("MY Easy");
//                    break;
//             }
        }
        $this->subCatalog = null;
        if($this->subCatalogId != null)
        {
            if($this->subCatalogId != 1 && $this->subCatalogId != 3 && $this->subCatalogId != 4)
            {
                $catalogs = Doctrine_Core::getTable("Catalog")->createQuery()
                        ->where("catalog_id=?",$this->subCatalogId)
                        ->execute();
                 foreach($catalogs as $catalog)
                 {
                     if($catalog->getCatalogId() == 1005)
                         $catalog->setDescription("偶像追踪");
                     $this->subCatalog = $catalog;
                     break;
                 }
            }
            else
            {
                 $this->subCatalog = new Catalog();
                 switch($this->subCatalogId)
                 {
                     case 1:
                         $this->subCatalog->setCatalogId(1);
                         $this->subCatalog->setDescription("头条");
                         break;
                     case 3:
                         $this->subCatalog->setCatalogId(3);
                         $this->subCatalog->setDescription("明星百科");
                         break;
                     case 4:
                         $this->subCatalog->setCatalogId(4);
                         $this->subCatalog->setDescription("美图");
                         break;
                 }

            }

        }
    }
}
